#ifndef _DATA_PLOT_H
#define _DATA_PLOT_H 1
#include <QtGlobal>
#include <QString>
#include <qwt_plot.h>
#include <qwt_text.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_panner.h>
#include <qwt_plot_picker.h>
#include <qwt_symbol.h>
#include <qwt_curve_fitter.h>
#include <qwt_painter.h>
#include <qwt_plot_canvas.h>
#include <qwt_plot_marker.h>
#include <qwt_plot_curve.h>
#include <qwt_scale_widget.h>
#include <qwt_legend.h>
#include <qwt_scale_draw.h>
#include <qwt_math.h>
#include <QGridLayout>
#include<QMenu>

#include "plot2d_dialog.h"

const int PLOT_SIZE = 200;      // 0 to 200

using namespace std;

class Plot_2D : public QwtPlot
{
    Q_OBJECT

public:
    Plot_2D(QWidget* = NULL);
    QString Xlabel, Y1label, Y2label;
    enum { curveCount = 4 };
    QDialog *Plot2D_diag;
    QwtScaleMap xMap[curveCount];
    QwtScaleMap yMap[curveCount];
    QwtPlotCurve curve[curveCount];
   Plot_2D_config *config;
        QList<myGraph> *list_of_graph;
Plot2D_Dialog *plot_2D_properties;





public slots:
    void setplot(QList<float> x,QList<float> y1, QList<float> y2, QString LegendL, QString LegendR);
    void setplot_from_diag();
    void InitPlot(QWidget *parentt);
    void moved(const QPoint &);
    void selected(const QwtPolygon &);
private slots:
    void showContextMenuFor_plot2D(const QPoint &pos);
    void Show_Diag_properties();

protected:

private:

    QwtPlotZoomer *d_zoomer[2];
    QwtPlotPicker *d_picker;
    QwtPlotPanner *d_panner;
    void showInfo(QString text);
    void alignScales();

};


#endif
